<?php

/**
 * this class provides functions for working with normal menu buttons
 * @author		ungerboeck simon <su@militaerversand.at>
 *
 */
class NormalMenuButton extends EasyUIMenuButton{
    private $subMenu = null;
    
    
    /************************************************************************
     ************************** PUBLIC FUNCTIONS ****************************
    ************************************************************************/
    
    public function __construct($text){
        $this->setText($text);
    }
    
    
    public function setSubMenu($subMenu){
        $this->subMenu = $subMenu;
    }
    
    
    /**
     * creates the sub menu with all needed attributes
     * @return        string        $output
     */
    public function create(){
        $output = '<div ' . $this->getActionTag();
        $output .= $this->getDataOptionTag() . '><span ';
        $output .= $this->getIdTag();        
        $output .= '>' . $this->getText() . '</span>';
        $output .= (isset($this->subMenu) ? $this->subMenu->create() : '');
        $output .= '</div>';
        return $output;
    }
}